package com.mapper;

import com.pojo.Students;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author 霞
* @description 针对表【s_student】的数据库操作Mapper
* @createDate 2024-11-20 10:43:11
* @Entity com.pojo.Students
*/
public interface StudentsMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Students record);

    int insertSelective(Students record);

    Students selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Students record);

    int updateByPrimaryKey(Students record);

    @Select("select * from s_student where id = #{id}")
    Students selectStudentById (int id);

    @Update("update s_student set name = #{name},age = #{age},cid = #{cid}"+" where id = #{id}")
    int updateStudents(Students record);

    @Select("select * from s_student where cid = #{id}")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "sge",property = "age"),
    })
    List<Students> selectStudentsByUserId(int id);
}
